/**
 * <copyright>
 * </copyright>
 *

 */
package hu.bme.mit.androtext.age.age.impl;

import hu.bme.mit.androtext.age.age.AgePackage;
import hu.bme.mit.androtext.age.age.AndroidApplication;

import hu.bme.mit.androtext.androDataLang.AndroDataRoot;

import hu.bme.mit.androtext.nav.androNav.AndroNavRoot;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Android Application</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link hu.bme.mit.androtext.age.age.impl.AndroidApplicationImpl#getApplicationName <em>Application Name</em>}</li>
 *   <li>{@link hu.bme.mit.androtext.age.age.impl.AndroidApplicationImpl#getProjectName <em>Project Name</em>}</li>
 *   <li>{@link hu.bme.mit.androtext.age.age.impl.AndroidApplicationImpl#getPackageName <em>Package Name</em>}</li>
 *   <li>{@link hu.bme.mit.androtext.age.age.impl.AndroidApplicationImpl#getData <em>Data</em>}</li>
 *   <li>{@link hu.bme.mit.androtext.age.age.impl.AndroidApplicationImpl#getUi <em>Ui</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class AndroidApplicationImpl extends MinimalEObjectImpl.Container implements AndroidApplication
{
  /**
   * The default value of the '{@link #getApplicationName() <em>Application Name</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getApplicationName()
   * @generated
   * @ordered
   */
  protected static final String APPLICATION_NAME_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getApplicationName() <em>Application Name</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getApplicationName()
   * @generated
   * @ordered
   */
  protected String applicationName = APPLICATION_NAME_EDEFAULT;

  /**
   * The default value of the '{@link #getProjectName() <em>Project Name</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getProjectName()
   * @generated
   * @ordered
   */
  protected static final String PROJECT_NAME_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getProjectName() <em>Project Name</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getProjectName()
   * @generated
   * @ordered
   */
  protected String projectName = PROJECT_NAME_EDEFAULT;

  /**
   * The default value of the '{@link #getPackageName() <em>Package Name</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getPackageName()
   * @generated
   * @ordered
   */
  protected static final String PACKAGE_NAME_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getPackageName() <em>Package Name</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getPackageName()
   * @generated
   * @ordered
   */
  protected String packageName = PACKAGE_NAME_EDEFAULT;

  /**
   * The cached value of the '{@link #getData() <em>Data</em>}' reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getData()
   * @generated
   * @ordered
   */
  protected AndroDataRoot data;

  /**
   * The cached value of the '{@link #getUi() <em>Ui</em>}' reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getUi()
   * @generated
   * @ordered
   */
  protected AndroNavRoot ui;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected AndroidApplicationImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return AgePackage.Literals.ANDROID_APPLICATION;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getApplicationName()
  {
    return applicationName;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setApplicationName(String newApplicationName)
  {
    String oldApplicationName = applicationName;
    applicationName = newApplicationName;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, AgePackage.ANDROID_APPLICATION__APPLICATION_NAME, oldApplicationName, applicationName));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getProjectName()
  {
    return projectName;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setProjectName(String newProjectName)
  {
    String oldProjectName = projectName;
    projectName = newProjectName;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, AgePackage.ANDROID_APPLICATION__PROJECT_NAME, oldProjectName, projectName));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getPackageName()
  {
    return packageName;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setPackageName(String newPackageName)
  {
    String oldPackageName = packageName;
    packageName = newPackageName;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, AgePackage.ANDROID_APPLICATION__PACKAGE_NAME, oldPackageName, packageName));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public AndroDataRoot getData()
  {
    if (data != null && data.eIsProxy())
    {
      InternalEObject oldData = (InternalEObject)data;
      data = (AndroDataRoot)eResolveProxy(oldData);
      if (data != oldData)
      {
        if (eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, AgePackage.ANDROID_APPLICATION__DATA, oldData, data));
      }
    }
    return data;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public AndroDataRoot basicGetData()
  {
    return data;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setData(AndroDataRoot newData)
  {
    AndroDataRoot oldData = data;
    data = newData;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, AgePackage.ANDROID_APPLICATION__DATA, oldData, data));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public AndroNavRoot getUi()
  {
    if (ui != null && ui.eIsProxy())
    {
      InternalEObject oldUi = (InternalEObject)ui;
      ui = (AndroNavRoot)eResolveProxy(oldUi);
      if (ui != oldUi)
      {
        if (eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, AgePackage.ANDROID_APPLICATION__UI, oldUi, ui));
      }
    }
    return ui;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public AndroNavRoot basicGetUi()
  {
    return ui;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setUi(AndroNavRoot newUi)
  {
    AndroNavRoot oldUi = ui;
    ui = newUi;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, AgePackage.ANDROID_APPLICATION__UI, oldUi, ui));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case AgePackage.ANDROID_APPLICATION__APPLICATION_NAME:
        return getApplicationName();
      case AgePackage.ANDROID_APPLICATION__PROJECT_NAME:
        return getProjectName();
      case AgePackage.ANDROID_APPLICATION__PACKAGE_NAME:
        return getPackageName();
      case AgePackage.ANDROID_APPLICATION__DATA:
        if (resolve) return getData();
        return basicGetData();
      case AgePackage.ANDROID_APPLICATION__UI:
        if (resolve) return getUi();
        return basicGetUi();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case AgePackage.ANDROID_APPLICATION__APPLICATION_NAME:
        setApplicationName((String)newValue);
        return;
      case AgePackage.ANDROID_APPLICATION__PROJECT_NAME:
        setProjectName((String)newValue);
        return;
      case AgePackage.ANDROID_APPLICATION__PACKAGE_NAME:
        setPackageName((String)newValue);
        return;
      case AgePackage.ANDROID_APPLICATION__DATA:
        setData((AndroDataRoot)newValue);
        return;
      case AgePackage.ANDROID_APPLICATION__UI:
        setUi((AndroNavRoot)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case AgePackage.ANDROID_APPLICATION__APPLICATION_NAME:
        setApplicationName(APPLICATION_NAME_EDEFAULT);
        return;
      case AgePackage.ANDROID_APPLICATION__PROJECT_NAME:
        setProjectName(PROJECT_NAME_EDEFAULT);
        return;
      case AgePackage.ANDROID_APPLICATION__PACKAGE_NAME:
        setPackageName(PACKAGE_NAME_EDEFAULT);
        return;
      case AgePackage.ANDROID_APPLICATION__DATA:
        setData((AndroDataRoot)null);
        return;
      case AgePackage.ANDROID_APPLICATION__UI:
        setUi((AndroNavRoot)null);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case AgePackage.ANDROID_APPLICATION__APPLICATION_NAME:
        return APPLICATION_NAME_EDEFAULT == null ? applicationName != null : !APPLICATION_NAME_EDEFAULT.equals(applicationName);
      case AgePackage.ANDROID_APPLICATION__PROJECT_NAME:
        return PROJECT_NAME_EDEFAULT == null ? projectName != null : !PROJECT_NAME_EDEFAULT.equals(projectName);
      case AgePackage.ANDROID_APPLICATION__PACKAGE_NAME:
        return PACKAGE_NAME_EDEFAULT == null ? packageName != null : !PACKAGE_NAME_EDEFAULT.equals(packageName);
      case AgePackage.ANDROID_APPLICATION__DATA:
        return data != null;
      case AgePackage.ANDROID_APPLICATION__UI:
        return ui != null;
    }
    return super.eIsSet(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String toString()
  {
    if (eIsProxy()) return super.toString();

    StringBuffer result = new StringBuffer(super.toString());
    result.append(" (applicationName: ");
    result.append(applicationName);
    result.append(", projectName: ");
    result.append(projectName);
    result.append(", packageName: ");
    result.append(packageName);
    result.append(')');
    return result.toString();
  }

} //AndroidApplicationImpl
